type
  Robot* = object
    id*: int
    name*: string

var
  global = 0

proc toChars(id: int): string =
  var x = id
  for i in 0..1:
    result.add chr(x mod 26 + 'A'.ord)
    x = x div 26

  for i in 0..2:
    result.add chr(x mod 10 + '0'.ord)
    x = x div 10

proc makeRobot*(): Robot = 
  let id = global
  global.inc

  Robot(id: id, name: toChars(id))

proc reset*(r: var Robot) =
  r.id = global
  global.inc

  r.name = toChars(r.id)